package com.uzai.console.web.pyq;

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.ApiSort;
import com.uzai.console.annotation.SystemLogType;
import com.uzai.console.dto.pyq.pyqfollowconfig.PyqFollowConfigDto;
import com.uzai.console.dto.pyq.pyqfollowconfig.PyqFollowConfigIdDto;
import com.uzai.console.dto.pyq.pyqfollowconfig.PyqFollowConfigQuery;
import com.uzai.console.dto.pyq.pyqfollowconfig.PyqFollowConfigStatusDto;
import com.uzai.console.enums.OperationTypeEnum;
import com.uzai.console.enums.SystemModelEnum;
import com.uzai.console.service.pyq.PyqFollowConfigService;
import com.uzai.console.vo.pyq.pyqfollowconfig.PyqFollowConfigVo;
import com.uzai.console.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * 朋友圈自动跟发配置
 * @author liuqi
 * @date 2021年08月16日 15:11
 */
@Api(value = "自动跟发配置",tags = "个人微信|朋友圈|自动跟发配置")
@ApiSort(31)
@RestController
public class PyqFollowConfigController extends BaseController {
    private Logger logger = LoggerFactory.getLogger(PyqFollowConfigController.class);

    @Autowired
    private PyqFollowConfigService pyqFollowConfigService;

    @ApiOperation(value = "分页查询自动跟发配置列表", notes = "分页查询自动跟发配置列表", response = PyqFollowConfigVo.class)
    @ApiOperationSupport(order = 1)
    @PostMapping("/pyqFollowConfig/findPyqFollowConfigList")
    public Object findPyqFollowConfigList(@RequestBody PyqFollowConfigQuery pyqFollowConfigQuery){
        return pyqFollowConfigService.findPyqFollowConfigList(pyqFollowConfigQuery);
    }

    @SystemLogType(model = SystemModelEnum.PyqFollowConfig, type = OperationTypeEnum.ADD)
    @ApiOperation(value = "添加自动跟发配置", notes = "添加自动跟发配置")
    @ApiOperationSupport(order = 2)
    @PostMapping("/pyqFollowConfig/addPyqFollowConfig")
    public Object addPyqFollowConfig(@RequestBody PyqFollowConfigDto pyqFollowConfigDto){
        pyqFollowConfigService.addPyqFollowConfig(pyqFollowConfigDto);
        return true;
    }

    @SystemLogType(model = SystemModelEnum.PyqFollowConfig, type = OperationTypeEnum.UPDATE)
    @ApiOperation(value = "编辑自动跟发配置", notes = "编辑自动跟发配置" )
    @ApiOperationSupport(order = 3)
    @PostMapping("/pyqFollowConfig/updatePyqFollowConfig")
    public Object updatePyqFollowConfig(@RequestBody PyqFollowConfigDto pyqFollowConfigDto){
        pyqFollowConfigService.updatePyqFollowConfig(pyqFollowConfigDto);
        return true;
    }

    @SystemLogType(model = SystemModelEnum.PyqFollowConfig, type = OperationTypeEnum.DELETE)
    @ApiOperation(value = "删除", notes = "删除")
    @ApiOperationSupport(order = 4)
    @PostMapping("/pyqFollowConfig/deletePyqFollowConfig")
    public Object deletePyqFollowConfig(@RequestBody PyqFollowConfigIdDto pyqFollowConfigIdDto){
        pyqFollowConfigService.deletePyqFollowConfig(pyqFollowConfigIdDto);
        return true;
    }

    @ApiOperation(value = "查询自动跟发配置详情", notes = "查询自动跟发配置详情", response = PyqFollowConfigVo.class)
    @ApiOperationSupport(order = 5)
    @PostMapping("/pyqFollowConfig/findPyqFollowConfig")
    public Object findPyqFollowConfig(@RequestBody PyqFollowConfigIdDto pyqFollowConfigIdDto){
        return pyqFollowConfigService.findPyqFollowConfig(pyqFollowConfigIdDto);
    }

    @ApiOperation(value = "开启关闭自动跟发配置", notes = "开启关闭自动跟发配置", response = Boolean.class)
    @ApiOperationSupport(order = 6)
    @PostMapping("/pyqFollowConfig/updateStatus")
    public Object updateStatus(@RequestBody PyqFollowConfigStatusDto pyqFollowConfigStatusDto){
        pyqFollowConfigService.updateStatus(pyqFollowConfigStatusDto);
        return true;
    }

}
